import re,sys,os,random

def rand_str(n):
  st = ''
  for i in xrange(0,n):
	t = chr(ord('a')+random.randint(0,25))
	st = st + t
  return "'"+st+"'"

fc = open('customer.data','w')

nc = 10000
fc.write(str(nc)+'\n')
for x in xrange(1,nc+1):
  fc.write(str(x)+',')
  fc.write(rand_str(2)+",")
  fc.write(rand_str(2)+",")
  fc.write(rand_str(10)+",")
  fc.write(rand_str(10)+",")
  fc.write(rand_str(10)+",")
  fc.write(rand_str(10)+",")
  fc.write(rand_str(10)+",")
  fc.write(rand_str(10)+",")
  fc.write(rand_str(10)+"\n")

fc.close()

fi = open('item.data','w')
ni = 1000
fi.write(str(ni)+'\n')
for x in xrange(1,ni+1):
  fi.write(str(x)+',')
  fi.write(rand_str(6)+',')
  if x%378 == 0:
    fi.write(str(random.randint(0,25))+',')
  else:
    fi.write(str(random.randint(0,10))+',')
  fi.write(rand_str(10)+'\n')
fi.close()

def gen_cu(x):
  ret = ""
  ret += str(x)+','
  ret += rand_str(2)+","
  ret += rand_str(2)+","
  ret += rand_str(10)+","
  ret += rand_str(10)+","
  ret += rand_str(10)+","
  ret += rand_str(10)+","
  ret += rand_str(10)+","
  ret += rand_str(10)+","
  ret += rand_str(10)
  return ret


fq = open('query','w')
nq=50000
nq1=50
fq.write(str(nq)+'\n')
for x in xrange(5000,5000+nq):
  fq.write("INSERT INTO customer VALUES ");
  for y in xrange(0,nq1-1):
	fq.write('('+gen_cu(x*nq+y)+'),')
  fq.write('('+gen_cu(x*nq+nq-1)+');\n')

fq.close()
